package client.logic;

import client.logic.chat.Chatter;

/**
 * Class used to communicate with the client logic layer 
 */
public class Facade {

	private static Facade instance;
	private Controller _controller;

	private Facade(){
		_controller = new Controller();
	}

	public static Facade getInstance() {
		if (instance == null){
			instance = new Facade();
		}
		return instance;
	}

	public void login(String name, char[] password) {
		_controller.login(name , password);
	}

	public void logout() {
		_controller.logout();
	}

	public void register(String name, char[] password, String bday , String city, String country, String img) {
		_controller.register(name, password, bday, country, city, img);
	}

	public void askForOnline(){
		_controller.whosOnline();
	}

	public void askForAllUsers(){
		_controller.allUsers();
	}

	public void delete() {
		_controller.delete();
	}

	public void chat(Integer id, String name) {
		_controller.chat(id, name);
	}

	public void details(Integer integer) {
		_controller.details(integer);

	}

	public String getLoggedUser() {
		return _controller.getLoggedUser();
	}

	public void sendChatMessage(Chatter chatter, String message) {
		chatter.sendChatMessage(message);
	}
	
	public void resetChat(){
		_controller.resetChat();
	}

	public void resetChatWaiter() {
		_controller.resetChatWaiter();

	}

	public void closeChatWaiter() {
		_controller.closeChatWaiter();
		
	}

	public void closeChatStarter() {
		_controller.closeChatStarter();
	}
}
